/**
  * @(#) NovelArticles.java  
  *
  * @author lihg 
  * @version V1.0 2013-10-5  
  *
  * Copyright (C) 2010,2013 , Lihg
  */

/**
 * 
 */
package cn.com.dshome.acquisition.entity.novel;

import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import cn.com.dshome.acquisition.entity.BaseEntity;

/**
 * 
 * Purpose:文章表
 * 
 * @author lihg 
 * @see	    
 * @since
 */
@Entity
@Table(name = "DSHOME_NOVEL_ARTICLES")
public class NovelArticles extends BaseEntity {

	private static final long serialVersionUID = -4866161858055887172L;
	
	/**
	 * 名称
	 */
	@Column(name = "name" , length = 64)
	private String name ;
	
	/**
	 * 描述
	 */
	@Column(name = "description" , length = 512)
	private String description ;
	
	/**
	 * 作者
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "author_id", referencedColumnName = "id")
	private NovelAuthors author ;
	
	/**
	 * 文章分类
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "category_id" , referencedColumnName = "id")
	private NovelCategories category ;
	
	/**
	 * 备注
	 */
	@Column(name = "remark" , length = 256)
	private String remark ;
	
	/**
	 * 上次更新时间
	 */
	@Column(name = "last_update_time")
	private Date lastUpdateTime ;
	
	/**
	 * 字数
	 */
	@Column(name = "word_count")
	private Integer wordCount ;
	
	/**
	 * 小说章节列表
	 */
	@OneToMany(fetch = FetchType.LAZY , mappedBy = "article" , cascade = CascadeType.PERSIST)
	@OrderBy("updateTime asc")
	private Set<NovelChapters> chapterSet = new LinkedHashSet<NovelChapters>() ;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the author
	 */
	public NovelAuthors getAuthor() {
		return author;
	}

	/**
	 * @param author the author to set
	 */
	public void setAuthor(NovelAuthors author) {
		this.author = author;
	}

	/**
	 * @return the category
	 */
	public NovelCategories getCategory() {
		return category;
	}

	/**
	 * @param category the category to set
	 */
	public void setCategory(NovelCategories category) {
		this.category = category;
	}

	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @return the lastUpdateTime
	 */
	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}

	/**
	 * @param lastUpdateTime the lastUpdateTime to set
	 */
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	/**
	 * @return the wordCount
	 */
	public Integer getWordCount() {
		return wordCount;
	}

	/**
	 * @param wordCount the wordCount to set
	 */
	public void setWordCount(Integer wordCount) {
		this.wordCount = wordCount;
	}

	/**
	 * @return the chapterSet
	 */
	public Set<NovelChapters> getChapterSet() {
		return chapterSet;
	}

	/**
	 * @param chapterSet the chapterSet to set
	 */
	public void setChapterSet(Set<NovelChapters> chapterSet) {
		this.chapterSet = chapterSet;
	}
}


/**
 * Revision history
 * -------------------------------------------------------------------------
 * 
 * Date Author Note
 * -------------------------------------------------------------------------
 * 2013-10-5 下午12:39:52 lihg 创建版本
 */